package com.cms.recursoshumanos.object;

public class Apn {
	private String id="";
	private String country="";
	private String company = "";
	private String description = "";
	private String apn = "";
	private String user="";
	private String password="";
	 
	public void setID(String id) {this.id = id;}
 	public String getID() {return id;}
	public void setCountry(String country) {this.country = country;}
 	public String getCountry() {return country;}
	public void setCompany(String company) {this.company = company;}
 	public String getCompany() {return company;}
	public void setDescription(String company, String country) {this.description = company+"("+country+")";}
 	public String getDescription() {return description;}
	public void setAPN(String apn) {this.apn = apn;}
 	public String getAPN() {return apn;}
	public void setUser(String user) {this.user = user;}
 	public String getUser() {return user;}
	public void setPassword(String password) {this.password = password;}
 	public String getPassword() {return password;}

 	public Apn[] getAPNs(){
 		int size=apns.length;
 		Apn[] apnList = new Apn[size];
 		Apn item;
 		for (int i = 0; i < size; i++){
 			item=new Apn();
 			item.setID(String.valueOf(i));
 			item.setCountry(countries[i]);
 			item.setCompany(companies[i]);
 			item.setDescription(companies[i],countries[i]);
 			item.setAPN(apns[i]);
 			item.setUser(users[i]);
 			item.setPassword(passwords[i]);
 			apnList[i]=item;
 		}
 		return apnList;
 	}
 	public String[] getApnDescriptions(){
 		int size = companies.length;
  		String[] descrip = new String[size];
 		for (int i = 0; i < size; i++){
 			descrip[i]=companies[i]+"("+countries[i]+")";
 		}
 		return descrip;
 	}
 	private Apn getApnByID(String strID){
 		Apn[] apnList =getAPNs();
 		return apnList[Integer.parseInt(strID)];
 	}
 	public String[] getApnParams(String strID){
 		Apn apn =getApnByID(strID);
 		String[] params=new String[3];
 		params[0]=apn.getAPN();
		params[1]=apn.getUser();
		params[2]=apn.getPassword();
 		return params;
 	}
 	private String[] countries={"Select","Guatemala","Guatemala","Mexico","USA","Venezuela"};
 	private String[] companies={"","Comcel","PCS Digital","Telcel","T-Mobile","Digitel	TIM"};
 	private String[] apns={"","Wap.tigo.gt","ideasalo","internet.itelcel.com","epc.tmobile.com","gprsweb.digiitel.ve"};
 	private String[] users={"","Wap","guest","webgprs","",""};
 	private String[] passwords={"","Wap","guest","webgprs2002","",""};
}

